#include <iostream>
#include <string>
#include <algorithm>
#include <unordered_set>
using namespace std;
int n;
string s;
int main()
{
	cin >> n;
	unordered_set<string> hash;
	while (n--)
	{
		cin >> s;
		sort(s.begin(), s.end());
		hash.insert(s);
	}
	cout << hash.size() << endl;
	return 0;
}